package com.weishu.core.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.weishu.core.entity.JrRentInstallment;
import com.weishu.core.mapper.JrRentInstallmentMapper;
import com.weishu.core.service.IJrRentInstallmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 房租分期申请 服务实现类
 * </p>
 *
 * @author zgx
 * @since 2021-10-19
 */
@Service
public class JrRentInstallmentServiceImpl extends ServiceImpl<JrRentInstallmentMapper, JrRentInstallment> implements IJrRentInstallmentService {
    @Resource
    private JrRentInstallmentMapper jrRentInstallmentMapper;

    @Override
    public PageInfo<JrRentInstallment> getList(@RequestParam(defaultValue = "1")Integer pageNum, @RequestParam(defaultValue = "10")Integer pageSize , JrRentInstallment jrRentInstallment) {
        PageHelper.startPage(pageNum,pageSize);
        List<JrRentInstallment> list = jrRentInstallmentMapper.getList(jrRentInstallment);
        PageInfo<JrRentInstallment> info = new PageInfo<>(list);
        return info;
    }

    @Override
    public JrRentInstallment selectJrRentInstallment(Long valueOf) {
        return jrRentInstallmentMapper.selectJrRentInstallment(valueOf);
    }

    @Override
    public int updateJrRentInstallment(JrRentInstallment jrRentInstallment) {
        return jrRentInstallmentMapper.updateJrRentInstallment(jrRentInstallment);
    }
}
